<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>{block name="title"}{$title|default='title'}{/block}</title>
	{:Yoyo\\yoyo_scripts()}
	<link
      href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
      rel="stylesheet"
    />
    <!-- Tailwind Elements CSS -->
    <link rel="stylesheet" href="/static/tw/css/index.min.css" />
    <link rel="stylesheet" href="/static/js/viewer/viewer.min.css" />
    <link rel="stylesheet" href="/static/js/sweetalert/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/js/jquery-tags-input/jquery.tagsinput.min.css" />
    <link rel="stylesheet" href="/static/js/wang-editor/css/style.css" />
    <link rel="stylesheet" href="/static/css/fontawesome.min.css" />
  	<link rel="stylesheet" href="/static/css/brands.min.css" />
  	<link rel="stylesheet" href="/static/css/solid.min.css" />
	<script src="https://cdn.tailwindcss.com"></script>
	{block name="style"}{/block}
    <link rel="stylesheet" type="text/css" href="/static/css/customer.css" />
	<script>
	  tailwind.config = {
	    theme: {
	      extend: {
	        fontFamily: {
	          sans: ['Inter', 'sans-serif'],
	        },
	      }
	    }
	  }
	</script>
</head>
<body>
	{block name="nav"}
	{include file="public/nav"}
	{/block}

	{block name="sidebar"}
	{include file="public/sidebar"}
	{/block}


	<!-- Start your project here-->
    <div class="mx-auto">
	{block name="content"}
	{/block}
    </div>
    <!-- End your project here-->
 
	{load href="/static/js/jquery-3.6.1.min.js" /}
	{load href="/static/tw/js/index.min.js" /}
	{load href="/static/js/viewer/viewer.min.js" /}
	{load href="/static/js/sweetalert/sweetalert.min.js" /}
	{load href="/static/js/coco-message.min.js" /}
	{load href="/static/js/jquery-tags-input/jquery.tagsinput.min.js" /}
	{load href="/static/js/wang-editor/js/index.js" /}
	{load href="/static/js/nengjj.js" /}

	<script src="/static/js/common.js"></script>
	<script>
	const { createEditor, createToolbar } = window.wangEditor;
	yoyo.file_upload_url     = '{$file_upload_url ? $file_upload_url : url("admin/attachment/upload", ["dir" => "files", "module" => MODULE])}';
	yoyo.image_upload_url    = '{$image_upload_url ? $image_upload_url : url("admin/attachment/upload", ["dir" => "images", "module" => MODULE])}';
	yoyo.upload_check_url    = '{$upload_check_url ? $upload_check_url : url("admin/ajax/check")}';
	yoyo.wangeditor_emotions = "/static/js/wang-editor/emotions.data";
	</script>

	<script type="text/javascript">
    var datepickerTranslated = document.querySelector('.datepicker-translated');
    if(datepickerTranslated){
	    new window.Datepicker(datepickerTranslated, {
		    title: '日期选择',
		    monthsFull: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月',
		    '十月', '十一月', '十二月'],
		    monthsShort: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11','12'],
		    weekdaysFull: ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
		    weekdaysShort: ['日', '一', '二', '三', '四', '五', '六'],
		    weekdaysNarrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
		    okBtnText: 'Ok',
		    clearBtnText: '清除',
		    cancelBtnText: '取消',
	    });
    }

    jQuery(document).ready(function() {
	    jQuery('.js-tags-input').tagsInput({
	        height: 'auto',
	        width: '100%',
	        defaultText: '添加标签',
	        removeWithBackspace: true,
	        delimiter: [',']
	    });
	    jQuery('.js-gallery').each(function(){
	        jQuery(this).viewer({ url: 'data-original' });
	    });
	    $('.js-wangeditor').each(function () {
	        var wangeditor_name = $(this).attr('name');
	        var wrapper_id      = $(this).attr('id');
	        var imgExt          = $(this).data('img-ext') || '';
	        var editorConfig    = {
			    placeholder: '请输入',
			    onChange(editor) {
			  		const html = editor.getHtml()
			      	console.log('editor content', html)
			      	// 也可以同步到 <textarea>
			      	$('#'+wrapper_id).val(html);
			    }
			}
			const editor = createEditor({
			    selector: '#'+wrapper_id+'—wrapper',
			    html: '<p><br></p>',
			    config: editorConfig,
			    mode: 'simple', // or 'simple'
			})

			const toolbarConfig = {}

			const toolbar = createToolbar({
			    editor,
			    selector: '#'+wrapper_id+'-toolbar-container',
			    config: toolbarConfig,
			    mode: 'default', // or 'simple'
			});
	    });
    });
	</script>

	
	{block name="script"}{/block}
</body>
</html>